/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package opera.InterfaceGrafica.PaineisDeCadastro;


import javax.swing.JRadioButton;
import javax.swing.JTextField;

/**
 *
 * @author Luciano
 */
public class PnlCadastrarFichaParte01 extends javax.swing.JPanel {

    /**
     * Getters
     */    
    public JTextField getTxtNomeJogador(){
        return txtNomeJogador;
    }
    public JTextField getTxtNomePersonagem(){
        return txtNomePersonagem;
    }
    
    public JTextField getTxtCampanha(){
        return txtCampanha;
    }
    public JTextField getTxtExperiencia(){
        return txtExperiencia;
    }
    
    public JRadioButton getRdbJogador(){
        return rdbJogador;
    }
    public JRadioButton getRdbNpc(){
        return rdbNpc;
    }
    public JRadioButton getRdbMonstro(){
        return rdbMonstro;
    }

    public void setTxtCampanha(String txtCampanha) {
        this.txtCampanha.setText(txtCampanha);
    }

    public void setTxtExperiencia(String txtExperiencia) {
        this.txtExperiencia.setText(txtExperiencia);
    }

    public void setTxtNomeJogador(String txtNomeJogador) {
        this.txtNomeJogador.setText(txtNomeJogador);
    }

    public void setTxtNomePersonagem(String txtNomePersonagem) {
        this.txtNomePersonagem.setText(txtNomePersonagem);
    }
    
    
    /**
     * Creates new form CadastrarFicha
     */    
    public PnlCadastrarFichaParte01() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grpTipoFicha = new javax.swing.ButtonGroup();
        pnlNome = new javax.swing.JPanel();
        lblNomeJogador = new javax.swing.JLabel();
        lblNomePersonagem = new javax.swing.JLabel();
        txtNomeJogador = new javax.swing.JTextField();
        txtNomePersonagem = new javax.swing.JTextField();
        pnlTipoFicha = new javax.swing.JPanel();
        rdbJogador = new javax.swing.JRadioButton();
        rdbMonstro = new javax.swing.JRadioButton();
        rdbNpc = new javax.swing.JRadioButton();
        pnlCampanha = new javax.swing.JPanel();
        txtCampanha = new javax.swing.JTextField();
        pnlExperiencia = new javax.swing.JPanel();
        txtExperiencia = new javax.swing.JTextField();

        pnlNome.setBorder(javax.swing.BorderFactory.createTitledBorder("Nome"));

        lblNomeJogador.setText("Jogador:");
        lblNomeJogador.setToolTipText("Digite o Nome do Jogador");

        lblNomePersonagem.setText("Personagem:");
        lblNomePersonagem.setToolTipText("Digite o nome do Personagem");

        txtNomeJogador.setToolTipText("Digite o Nome do Jogador");

        txtNomePersonagem.setToolTipText("Digite o nome do Personagem");
        txtNomePersonagem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNomePersonagemActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlNomeLayout = new javax.swing.GroupLayout(pnlNome);
        pnlNome.setLayout(pnlNomeLayout);
        pnlNomeLayout.setHorizontalGroup(
            pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlNomeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNomePersonagem)
                    .addComponent(lblNomeJogador))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNomeJogador)
                    .addComponent(txtNomePersonagem))
                .addContainerGap())
        );
        pnlNomeLayout.setVerticalGroup(
            pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlNomeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNomeJogador)
                    .addComponent(txtNomeJogador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlNomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNomePersonagem)
                    .addComponent(txtNomePersonagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlTipoFicha.setBorder(javax.swing.BorderFactory.createTitledBorder("Tipo de Ficha"));
        pnlTipoFicha.setToolTipText("Selecione o Tipo de Ficha a ser Criada");

        grpTipoFicha.add(rdbJogador);
        rdbJogador.setSelected(true);
        rdbJogador.setText("Jogador");
        rdbJogador.setToolTipText("Tipo de Ficha: Jogador");
        rdbJogador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdbJogadorActionPerformed(evt);
            }
        });

        grpTipoFicha.add(rdbMonstro);
        rdbMonstro.setText("Monstro");
        rdbMonstro.setToolTipText("Tipo de Ficha: Monstro");
        rdbMonstro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdbMonstroActionPerformed(evt);
            }
        });

        grpTipoFicha.add(rdbNpc);
        rdbNpc.setText("NPC");
        rdbNpc.setToolTipText("Tipo de Ficha: NPC");
        rdbNpc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdbNpcActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlTipoFichaLayout = new javax.swing.GroupLayout(pnlTipoFicha);
        pnlTipoFicha.setLayout(pnlTipoFichaLayout);
        pnlTipoFichaLayout.setHorizontalGroup(
            pnlTipoFichaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlTipoFichaLayout.createSequentialGroup()
                .addGroup(pnlTipoFichaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rdbJogador)
                    .addComponent(rdbMonstro)
                    .addComponent(rdbNpc))
                .addGap(0, 8, Short.MAX_VALUE))
        );
        pnlTipoFichaLayout.setVerticalGroup(
            pnlTipoFichaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlTipoFichaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdbJogador)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdbMonstro)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdbNpc)
                .addContainerGap(18, Short.MAX_VALUE))
        );

        pnlCampanha.setBorder(javax.swing.BorderFactory.createTitledBorder("Campanha"));
        pnlCampanha.setToolTipText("Digite a Campanha do Jogador");

        txtCampanha.setToolTipText("Digite a Campanha do Jogador");
        txtCampanha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCampanhaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlCampanhaLayout = new javax.swing.GroupLayout(pnlCampanha);
        pnlCampanha.setLayout(pnlCampanhaLayout);
        pnlCampanhaLayout.setHorizontalGroup(
            pnlCampanhaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(txtCampanha, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
        );
        pnlCampanhaLayout.setVerticalGroup(
            pnlCampanhaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(txtCampanha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pnlExperiencia.setBorder(javax.swing.BorderFactory.createTitledBorder("Experiencia"));
        pnlExperiencia.setToolTipText("Digite o valor da experiencia do jogador");

        txtExperiencia.setToolTipText("Digite o valor da experiencia do jogador");
        txtExperiencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtExperienciaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlExperienciaLayout = new javax.swing.GroupLayout(pnlExperiencia);
        pnlExperiencia.setLayout(pnlExperienciaLayout);
        pnlExperienciaLayout.setHorizontalGroup(
            pnlExperienciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(txtExperiencia)
        );
        pnlExperienciaLayout.setVerticalGroup(
            pnlExperienciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(txtExperiencia)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(pnlTipoFicha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pnlCampanha, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(pnlExperiencia, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(pnlCampanha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9)
                        .addComponent(pnlExperiencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(pnlTipoFicha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtNomePersonagemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomePersonagemActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNomePersonagemActionPerformed

    private void rdbJogadorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbJogadorActionPerformed
        // TODO add your handling code here:
        habilitarEntradas(true);
    }//GEN-LAST:event_rdbJogadorActionPerformed

    private void txtCampanhaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCampanhaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCampanhaActionPerformed

    private void txtExperienciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtExperienciaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtExperienciaActionPerformed

    private void rdbMonstroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbMonstroActionPerformed
        // TODO add your handling code here:
        habilitarEntradas(false);
    }//GEN-LAST:event_rdbMonstroActionPerformed

    private void rdbNpcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbNpcActionPerformed
        // TODO add your handling code here:
        habilitarEntradas(false);
    }//GEN-LAST:event_rdbNpcActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup grpTipoFicha;
    private javax.swing.JLabel lblNomeJogador;
    private javax.swing.JLabel lblNomePersonagem;
    private javax.swing.JPanel pnlCampanha;
    private javax.swing.JPanel pnlExperiencia;
    private javax.swing.JPanel pnlNome;
    private javax.swing.JPanel pnlTipoFicha;
    private javax.swing.JRadioButton rdbJogador;
    private javax.swing.JRadioButton rdbMonstro;
    private javax.swing.JRadioButton rdbNpc;
    private javax.swing.JTextField txtCampanha;
    private javax.swing.JTextField txtExperiencia;
    private javax.swing.JTextField txtNomeJogador;
    private javax.swing.JTextField txtNomePersonagem;
    // End of variables declaration//GEN-END:variables

    public void habilitarEntradas(boolean habilitar){
        txtNomeJogador.setEditable(habilitar);
        txtCampanha.setEditable(habilitar);
        if(!habilitar){
            txtNomeJogador.setText(null);
            txtCampanha.setText(null);
        }
    }

    
    
}
